class StatisticsController < ApplicationController
  def index
    @number_of_questions = Question.find(:all).size
    @number_of_questionnaires = Questionnaire.find(:all).size
    @number_of_categories = Category.find(:all).size
    @user_statistics = []
    User.find(:all).each do |user|
      @user_statistics << [user.login, user.questions.size, user.questionnaires.size]
    end
    @user_statistics.sort_by {|a,b| b[1] <=> a[1]}
  end
end
